<{include file="../modules/_manager/header.html" title='厂家'}>

<script src="<{$ROOTPATH}>/_manager/scripts/vars/fact.js.php"></script>
<script> jQuery(function($){factory.init();}); </script>

<div class="block">
<h1>取引様の数は<b><{$len}></b>件</h1>
<h2><a class="typeLink" onclick="factory.todo(-1,2)">取引様を新規作成する</a></h2>

<table class="table_list">
	<thead class="listitem">
		<tr class="header">
			<td>取引様</td>
			<td>編集</td>
			<td>削除</td>
		</tr>
	</thead>
	<tbody class="listitem">
		<{if $len == 0}>
			<tr>
				<td colspan="3">
					<span class="blank_data">
						暂时没有类信息[<a class="typeLink" onclick="factory.todo(-1,2)">新規作成</a>]
					</span>
				</td>
			</tr>
		<{else}>
			<{foreach $listview as $entry}>
			<{if $entry@iteration is even by 1}>
				<tr class="iteration">
			<{else}>
				<tr>
			<{/if}>
				<td style="font-family:'<{$entry.fontset}>';">
					<a onclick="factory.todo(<{$entry.factId}>,5)" class="typeLink" style="width:250px;"><{$entry.name}></a>
				</td>
				<td>
					<{if $login_adminId == 1 or $login_levelno gt 85}>
					<a class="typeLink" onclick="factory.todo(<{$entry.factId}>,0)">編集</a>
					<{else}>
						-
					<{/if}>
				</td>
				<td>
					<{if $login_adminId == 1 or $login_levelno gt 85}>
						<a class="typeLink" 
							onclick="blockDesign.message( $(factory.delfact_form._name),'382px');$('#delete_fact_id').val('<{$entry.factId}>');">削除</a>
					<{else}>
						-
					<{/if}>
				</td>
			</tr>
			<tr style="display:none;">
				<td colspan="3">
					<table width="100%"  class="info" id="list_info_<{$entry.factId}>">
						<tr>
							<td colspan="4" style="font-weight: bold;font-size:14px;"><{$entry.name}></td>
						</tr>
						<tr>
							<td>担当者：</td>
							<td style="font-family:'<{$entry.fontset}>';"><{$entry.contact}></td>
							<td colspan="2"></td>
						</tr>
						<tr>
							<td>住所：</td>
							<td colspan="3" style="font-family:'<{$entry.fontset}>';"><{$entry.addr}></td>
						</tr>
						<tr>
							<td>連絡先：</td>
							<td colspan="3">TEL:<{$entry.tel}><br />QQ:<{$entry.qq}><br />Email:<{$entry.email}></td>
						</tr>
						<tr>
							<td>銀行：</td>
							<td style="font-family:'<{$entry.fontset}>';"><{$entry.bank}></td>
							<td style="font-family:'<{$entry.fontset}>';">支店：<{$entry.branch}></td>
							<td>口座番号：<{$entry.bankno}></td>
						</tr>
						<tr>
							<td colspan="4">詳細情報：</td>
						</tr>
						<tr>
							<td colspan="4" style="font-family:'<{$entry.fontset}>';"><b><{$entry.info}></b></td>
						</tr>
						<tr>
							<td colspan="4">
								<a class="typeLink" onclick="$.unblockUI();">Close</a>
							</td>
						</tr>
					</table>
					<input type="hidden" id="fact_name_hidden_<{$entry.factId}>" value="<{$entry.name}>" />
					<input type="hidden" id="fact_contact_hidden_<{$entry.factId}>" value="<{$entry.contact}>" />
					<input type="hidden" id="fact_tel_hidden_<{$entry.factId}>" value="<{$entry.tel}>" />
					<input type="hidden" id="fact_qq_hidden_<{$entry.factId}>" value="<{$entry.qq}>" />
					<input type="hidden" id="fact_email_hidden_<{$entry.factId}>" value="<{$entry.email}>" />
					<input type="hidden" id="fact_addr_hidden_<{$entry.factId}>" value="<{$entry.addr}>" />
					<input type="hidden" id="fact_bank_hidden_<{$entry.factId}>" value="<{$entry.bank}>" />
					<input type="hidden" id="fact_branch_hidden_<{$entry.factId}>" value="<{$entry.branch}>" />
					<input type="hidden" id="fact_bankno_hidden_<{$entry.factId}>" value="<{$entry.bankno}>" />
					<input type="hidden" id="fact_info_hidden_<{$entry.factId}>" value="<{$entry.info}>" />
					<input type="hidden" id="fact_lang_hidden_<{$entry.factId}>" value="<{$entry.lang}>" />
				</td>
			</tr>
			<{/foreach}>
		<{/if}>
	</tbody>
</table>
<{if $login_levelno gt 85}>
<div id="newfact_form" class="new_form" style="display:none;">
	<div id="newfact_form_title">取引様をを新規作成する</div>
		<div>
			<table>
				<tr>
					<td>言語：</td>
					<td><select id="fact_lang_text">
						<option value="1">中国語</option>
						<option value="2">日本語</option>
						<option value="3">英語</option>
						</select>
					</td>
					<td></td>
				</tr>
				<tr>
					<td>会社名：</td>
					<td><input type="text" id="fact_name_text"/></td>
					<td></td>
				</tr>
				<tr>
					<td>担当者：</td>
					<td><input type="text" id="fact_contact_text" style="width:160px;" /></td>
					<td></td>
				</tr>
				<tr>
					<td>TEL：</td>
					<td><input type="text" id="fact_tel_text" style="width:150px;" /></td>
					<td></td>
				</tr>
				<tr>
					<td>QQ：</td>
					<td><input type="text" id="fact_qq_text" style="width:150px;" /></td>
					<td></td>
				</tr>
				<tr>
					<td>email：</td>
					<td><input type="text" id="fact_email_text" style="width:150px;" /></td>
					<td></td>
				</tr>
				<tr>
					<td>住所：</td>
					<td><input type="text" id="fact_addr_text" style="width:300px;" /></td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td></td>
					<td></td>
				</tr>
				<tr>
					<td>銀行：</td>
					<td><input type="text" id="fact_bank_text" style="width:140px;" /></td>
					<td></td>
				</tr>
				<tr>
					<td>支店：</td>
					<td><input type="text" id="fact_branch_text" style="width:120px;" /></td>
					<td></td>
				</tr>
				<tr>
					<td>Bank No.</td>
					<td><input type="text" id="fact_bankno_text" style="width:260px;" /></td>
					<td></td>
				</tr>
				<tr>
					<td>詳細情報</td>
					<td>
						<textarea id="fact_info_text" style="width:260px;" ></textarea>
					</td>
					<td></td>
				</tr>
			</table>
			<a class="typeLink" id="newfact_form_ok" onclick="if($('#fact_id_hidden').val()==0)  
				factory.add(); else  factory.update();">新規作成</a>
		 	<a class="typeLink" onclick="$.unblockUI();">Close</a>
		 	<input type="hidden" id="fact_id_hidden" value="0">
		 </div>
	</div>
	<div id="delfact_form" class="new_form" style="display:none;">
		<div>
			取引様様を削除されます。<br/>削除しますか？
		</div>
		<div>
			<a class="typeLink" onclick="factory.todo(-1,1)">削除する</a> <a class="typeLink" onclick="$.unblockUI();">キャンセル</a>
		</div>
		<input type="hidden" id="delete_fact_id" value="" />
	</div>
</div>
<{/if}>
<{include file="../modules/_manager/footer.html"}>